package com.example.water_quality_analysis.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.water_quality_analysis.pojo.model.Data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.water_quality_analysis.pojo.model.WaterQuality;
import com.example.water_quality_analysis.pojo.model.WaterQualityYear;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * @author lin
 * @description 针对表【data】的数据库操作Mapper
 * @createDate 2024-07-02 15:57:43
 * @Entity com.example.water_quality_analysis.pojo.model.Data
 */
@Mapper
public interface DataMapper extends BaseMapper<Data> {

    int addDataByFile(Long deviceId, Long levelId, Date generateTime, Double ph, Double nh, Double tp,
                      Double tn, Double temp, Double dO, Double pp, Double tds, Double ftu);

    Page<Data> getWaterAllQuality(Page<Data> page);

    List<Data> getWaterQualityByDay(LocalDate day);

    WaterQuality getWaterQualityByDay2(LocalDate day);

    List<Data> getWaterQualityByMonths(LocalDate monthStart, LocalDate monthEnd);

    WaterQuality getWaterQualityByMonths2(LocalDate monthStart, LocalDate monthEnd);

    List<Data> getWaterQualityByYear(LocalDate yearStart, LocalDate yearEnd);

    WaterQuality getWaterQualityByYear2(LocalDate yearStart, LocalDate yearEnd);

    Page<WaterQuality> getAggregatedWaterQuality(Page<WaterQuality> page);

    Page<WaterQuality> getAggregatedMonthlyWaterQuality(Page<WaterQuality> page);

    Page<WaterQualityYear> getAggregatedYearlyWaterQuality(Page<WaterQualityYear> page);
}




